package com.hzncc.flowable_diboot.trial_contracts.entity;

import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableName;
import com.diboot.core.binding.query.BindQuery;
import com.diboot.core.binding.query.Comparison;
import com.diboot.core.entity.BaseModel;
import lombok.Getter;
import lombok.Setter;
import lombok.experimental.Accessors;
import org.hibernate.validator.constraints.Length;

import jakarta.validation.constraints.NotNull;
import java.math.BigDecimal;
import java.util.List;

/**
* 试用合同审批单 Entity 定义
* @author MyName
* @version 1.0
* @date 2024-10-17
* Copyright © MyCorp
*/

@TableName("mdl_trial_contract_audit")
@Getter @Setter @Accessors(chain = true)
public class TrialContractAudit extends BaseModel {
    private static final long serialVersionUID = 1372741011456574603L;

    /**
     * 租户
     */
    @NotNull(message = "租户不能为空")
    @TableField()
    private String tenantId;

    /**
     * 试用合同编号
     */
    @Length(max=50, message="试用合同编号长度应小于50")
    @BindQuery(comparison = Comparison.LIKE)
    @TableField()
    private String contractCode;

    /**
     * 合同版本
     */
    @TableField()
    private Long contractVersion;

    /**
     * 审批类型
     */
    @Length(max=20, message="审批类型长度应小于20")
    @BindQuery(comparison = Comparison.LIKE)
    @TableField()
    private String auditType;

    /**
     * 试用项目
     */
    @Length(max=50, message="试用项目长度应小于50")
    @BindQuery(comparison = Comparison.LIKE)
    @TableField()
    private String trialProject;

    /**
     * 客户名称
     */
    @Length(max=100, message="客户名称长度应小于100")
    @BindQuery(comparison = Comparison.LIKE)
    @TableField()
    private String customerName;

    /**
     * 合同类型
     */
    @TableField()
    private String contractType;

    /**
     * 客户性质
     */
    @TableField()
    private String customerNature;

    /**
     * 配套机床型号
     */
    @Length(max=100, message="配套机床型号长度应小于100")
    @BindQuery(comparison = Comparison.LIKE)
    @TableField()
    private String accompanyingMachineModel;

    /**
     * 数量
     */
    @TableField()
    private BigDecimal quantity;

    /**
     * 金额
     */
    @TableField()
    private BigDecimal amount;

    /**
     * 折扣/毛利率
     */
    @TableField()
    private BigDecimal discountOrGrossProfitMargin;

    /**
     * 最终用户
     */
    @Length(max=100, message="最终用户长度应小于100")
    @BindQuery(comparison = Comparison.LIKE)
    @TableField()
    private String endUser;

    /**
     * 交货期
     */
    @TableField()
    private BigDecimal deliveryPeriod;

    /**
     * 试用期限
     */
    @TableField()
    private Long trialPeriod;

    /**
     * 客户id
     */
    @Length(max=32, message="客户id长度应小于32")
    @BindQuery(comparison = Comparison.LIKE)
    @TableField()
    private String customerId;

    /**
     * 合同id
     */
    @Length(max=32, message="合同id长度应小于32")
    @BindQuery(comparison = Comparison.LIKE)
    @TableField()
    private String trialContractId;

    /**
     * 负责人
     */
    @TableField()
    private String principal;

    /**
     * 签订人
     */
    @TableField()
    private String signer;

    /**
     * 是否为公司合同模板
     */
    @TableField()
    private Boolean isCompanyTemplate;

    /**
     * 合同附件
     */
    @TableField()
    private String attachment;

    /**
     * 合同状态
     */
    @TableField()
    private String contractStatus;

    /**
     * 关注人
     */
    @TableField(exist = false)
    private List<String> starUids;

    /**
     * 试用合同类型
     */
    @TableField()
    private Integer trialContractType;


}